#include <stdbool.h>
struct TreeNode {
    int val;
    struct TreeNode *left;
    struct TreeNode *right;
};
 
//对称二叉树
bool isSameTree(struct TreeNode* T1,struct TreeNode* T2)
{
    if(!T1&&!T2) return true;
    if(!T1||!T2) return false;
    if(T1->val!=T2->val) return false;
    return isSameTree(T1->left,T2->right)&&isSameTree(T1->right,T2->left);
    //左子树的左子节点和右子树的右子节点相比 右子节点和左子节点比 相等即为true

}
bool isSymmetric(struct TreeNode* root){
    return isSameTree(root->left,root->right);
}